package com.xnyzc.lhy.resource.common.cp.dto;

import com.xnyzc.lhy.resource.common.cp.penum.CPErrorCode;
import lombok.Data;

import java.io.Serializable;

/**
 * 银联单笔代付返回值
 * @author haoyfa
 */
@Data
public class SingleTradeResult implements Serializable {
    private String errCode;
    private String errMsg;

    /**
     * 代办代付信息
     */
    private SingleQueryInfo data;

    public SingleTradeResult(String errCode, String errMsg){
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    public SingleTradeResult(CPErrorCode cpErrorCode){
        this.errCode = cpErrorCode.getValue().toString();
        this.errMsg = cpErrorCode.getDesc();
    }

    public SingleTradeResult(String errCode, String errMsg, SingleQueryInfo data){
        this.errCode = errCode;
        this.errMsg = errMsg;
        this.data = data;
    }

    public SingleTradeResult(CPErrorCode cpErrorCode, SingleQueryInfo data){
        this.errCode = cpErrorCode.getValue().toString();
        this.errMsg = cpErrorCode.getDesc();
        this.data = data;
    }
}
